<?php
/**
 * Created by PhpStorm.
 * User: 驭风者
 * Date: 2019/8/14
 * Time: 11:09
 */
namespace app\index\model;
use think\Model;

class User extends Model
{
    public function Cx($where)
    {
        return $this->where($where)->find();
    }

    public function getPower($uid)
    {
        return $this ->table('user_role')
            ->distinct( true )
            ->field( 'power.*' )
            ->join('role_power','user_role.r_id=role_power.r_id')
            ->join('power','power.id=role_power.p_id')
            ->where('user_role.u_id',$uid)
            ->select();

    }
}








?>